<template>
    <div class="">

        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item><i class="el-icon-lx-copy"></i> 添加客户</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <center>        
            <div class="qwe">
                <el-input v-model="name" placeholder="请输入公司名"></el-input>
                <el-input v-model="addr" placeholder="请输入公司地址"></el-input>
                <el-input v-model="username" placeholder="请输入收货人姓名"></el-input>
                <el-input v-model="phone" placeholder="请输入收货人电话"></el-input>
                <el-button type="primary" @click="submitForm()">添加</el-button>

            </div>
        </center>
    </div>
</template>

<script>
import {AddCustomer} from '../../api/api.js'
    export default {
        inject:['reload'],
        name: 'company',
        data() {
            return {
                name:"",
                addr:"",
                username:'',
                phone:"",
                uid:localStorage.getItem('uid')

            }
        },
        methods: {
            submitForm(){
               let params = {
                    name:this.name,
                    addr:this.addr,
                    username:this.username,
                    phone:this.phone,
                } 
                AddCustomer(params).then(res=>{
                    if(res.data.code == 200){
                        this.$message(res.data.message)
                        this.reload()
                    }else{
                        this.$message(res.data.message)
                    }
                })
            },
        },
        computed: {
            
        },
        mounted(){

        }
    }

</script>

<style>
.qwe{
    width: 16%;
    padding: "50%";
    text-align: center;

}
</style>


